package _21_多线程._1114_按序打印;


class Test {

    public static void main(String[] args) throws InterruptedException {

        for (int i = 0; i < 30000; ++i) {
            _1114_按序打印_LockSupport foo = new _1114_按序打印_LockSupport();
            Thread t = new Thread(() -> {
                try {
                    foo.first(() -> {
                        System.out.print("first");
                    });
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            });
            Thread t1 = new Thread(() -> {
                try {
                    foo.second(() -> {
                        System.out.print("second");
                    });
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            });
            Thread t2 = new Thread(() -> {
                try {
                    foo.third(() -> {
                        System.out.println("three");
                    });
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            });

            t1.start();
            t2.start();
            t.start();
            Thread.sleep(2);
        }


    }
}